<extend name="Public/base"/>
<block name="body">
    <div class="main-title">
        <h2>模块管理 （只有云市场中的模块方可检测更新）</h2>
    </div>
    <div class="with-padding clearfix" style="">
        <ul class="pull-left nav nav-secondary">
            <li id="type_all"><a href="{:U('lists',array('type'=>'all'))}">全部</a></li>
            <li id="type_installed"><a href="{:U('lists',array('type'=>'installed'))}">已安装</a></li>
            <li id="type_uninstalled"><a href="{:U('lists',array('type'=>'uninstalled'))}">未安装</a></li>
            <li id="type_core"><a href="{:U('lists',array('type'=>'core'))}">系统模块</a></li>
            <script>
                $('#type_{$type}').addClass('active');
            </script>
        </ul>
        <div class="pull-right">
            <a href="/index.php?s=/admin/module/lists/refresh/2.html" class="btn btn-success"><i class="icon-level-up"></i> 立刻检查更新</a>
            <a href="/index.php?s=/admin/module/lists/refresh/2.html" class="btn btn-primary"><i class="icon-repeat "></i> 刷新（读入新的模块）</a>&nbsp;<a
                href="/index.php?s=/admin/module/lists/refresh/1.html" class="btn btn-danger"><i class="icon-undo"></i> 重置（根据预设模块信息重置）</a>&nbsp;

        </div>


    </div>
    <div class="with-padding">
        <ul class="module-list">
            <volist name="modules" id="vo">

                <li class="clearfix">
                    <div class="cover-wrapper">
                        <empty name="vo.version_info.goods.cover_url">
                            <div class="cover-icon">
                                <i class="icon-{$vo.icon}"></i>
                            </div>
                            <else/>
                            <img class="cover"
                                 src="__CLOUD__/{$vo.version_info.goods.cover_url}"/>
                        </empty>


                    </div>
                    <div class="content-wrapper">
                        <div class="title">
                            <a href="{:U('edit?', array('name' => $vo['name']))}">{$vo.alias} <span class="text-muted">{$vo.name}</span></a>

                            <div class="pull-right"><span class="label label-info">{$vo.version_info.title}</span>
                                <empty name="vo.update_list">
                                    <else/>
                                    <a style="text-decoration: none" href="javascript:void(0)" data-role="update_btn" data-type="ajax" data-url="{:U('Cloud/getVersionList',array('token'=>$vo['token']))}" data-toggle="modal" data-title="有新版本可以更新" ><span class=" label label-success ">有新版{$vo.update_list.0.title}</span></a>
                                    <script>$(function(){
                                        $('[data-role="update_btn"]').tooltip('show');
                                    });
                                    </script>
                                </empty>
                            </div>
                        </div>
                        <div>
                            <p class="text-muted text-ellipsis">{$vo.summary}</p>
                        </div>
                        <div>开发者： <a style="color: #666">{$vo.developer}</a></div>
                        <div class="clearfix bottom-btns">
                            <div class="pull-left">
                                <empty name="vo.update_list">
                                    <else/>
                                    <a class="btn btn-success" href="{:U('Cloud/updateGoods',array('token'=>$vo['token']))}">更新</a>
                                    </empty><a class="btn btn-default"
                                                                                               href="{:U('edit?', array('name' => $vo['name']))}">编辑</a>
                                <if condition="$vo['can_uninstall'] ">
                                    <if condition="$vo['is_setup']">
                                        <a class="btn btn-danger"
                                           href="{:U('uninstall', array('id' => $vo['id']))}">卸载</a>
                                        <else/>
                                        <a class="btn btn-info"
                                           href="{:U('install', array('name' => $vo['name']))}">安装</a>
                                    </if>

                                </if>
                            </div>
                            <div class="pull-right">
                                <empty name="vo.token">
                                    <span class="label label-circle label-danger">本地模块</span>
                                    <else/>
                                    <a target="_blank" href="{:appstoreU('Appstore/Index/goodsDetail',array('token'=>$vo['token']))}" class="btn btn-info">去云市场查看</a>
                                </empty>
                            </div>
                        </div>
                    </div>
                </li>
            </volist>
        </ul>
    </div>

</block>